package models

import (
	"hospital-srv/basic/inits"
)

type UserEquipmentRelationship struct {
	UserId      int32 `gorm:"column:user_id;type:int;comment:用户id;primaryKey;not null;" json:"user_id"` // 用户id
	EquipmentId int32 `gorm:"column:equipment_id;type:int;comment:设备id;not null;" json:"equipment_id"`  // 设备id
}

func (u *UserEquipmentRelationship) TableName() string {
	return "user_equipment_relationship"
}

// 绑定设备
func (u *UserEquipmentRelationship) CreateRelation() error {
	return inits.DB.Create(&u).Error
}
